package com.itheima.mapper;

import com.itheima.pojo.Student;
import com.itheima.pojo.StudentQueryParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface StudentMapper {

    List<Student> pageStudent(StudentQueryParam studentQueryParam);

    void insertStudent(Student student);

    @Select("select * from student where id = #{id}")
    Student getStudentById(Integer id);

    void updateStudent(Student student);

    void deleteStudent(Integer[] ids);

    //update student set violation_score=violation_score+#{score},violation_count=violation_count+1 where id=#{id}
    void updateByIdAndScore(Integer id, LocalDate update,Integer score);
}
